function check(){
		var out = document.getElementById("tip");
//ID
		var ID = document.getElementById("uID");			
		if(ID.value==''){
			out.innerHTML='ID不能为空';
			ID.focus();
			return false;
		}else{
			var checkID=(/^[A-Za-z0-9_\-\u4e00-\u9fa5]{2,18}$/);
			if (!checkID.test(ID.value)) {
			out.innerHTML='ID 2-18个字';
				ID.focus();
				return false; 
			}
		if(Number(localStorage.getItem('user_count'))!=0)
		{
			var user_count=Number(localStorage.getItem('user_count'));
			for(var i=1;i<=user_count;i++)
			{
				var user=JSON.parse(localStorage.getItem(i));
				if(user[1]==ID.value)
				{
					out.innerHTML="ID已存在";
					return false;
				}		
			}
			
		}		
//email
		var email = document.getElementById('uemail');
		if(email.value==''){
			out.innerHTML=('邮箱不能为空');
			email.focus();
			return false;
		}else{
			var checkemail = /^[0-9a-zA-Z]+(?:[\_\.\-][a-z0-9\-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\.[a-zA-Z]+$/i;
			if(!checkemail.test(email.value)){
				out.innerHTML=('邮箱格式错误');
				email.focus();
				return false;
			}
		}		
	
//phone
		var phone = document.getElementById('uphone');
		if(phone.value==''){
			out.innerHTML=('手机号码不能为空');
			phone.focus();
			return false;
		}else{
			var phone_reg = /^13[0-9]{1}[0-9]{8}$|15[0-9]{1}[0-9]{8}$|18[0-9]{1}[0-9]{8}|17[0-9]{1}[0-9]{8}$|14[0-9]{1}[0-9]{8}/;
			if(!phone_reg.test(phone.value)){
				out.innerHTML=('手机号码格式错误');
				phone.focus();
				return false;
			}
		}
		
//password
		var pwd = document.getElementById('upassword');
		if(pwd.value==''){
			out.innerHTML=('密码不能为空');
			pwd.focus();
			return false;
		}else{
			var checkpwd = /^[A-Za-z0-9]+$/;
			if(!checkpwd.test(pwd.value)){
				out.innerHTML=('密码错误，密码由数字和字母组成');
				pwd.focus();
				return false;
			}else{
				if(pwd.value.length<6){
					out.innerHTML=('密码不能少于6位');
					pwd.focus();
					return false;
				}
			}
		}
//验证password
		var pwda = document.getElementById('upassworda');
		if(!(pwda.value==pwd.value)){
			out.innerHTML=('两次密码输入不一致');
			pwda.focus();
			return false;
		}
	var user_state=0;
	if(localStorage.getItem('user_count')==undefined)
	{
		var tag=1;
		localStorage.setItem('user_count','1');
		var time = new Date();
		var user_array=[tag,ID.value,email.value,time,phone.value,pwd.value,user_state];
		localStorage.setItem('1',JSON.stringify(user_array));
	}else{
		var tag=Number(localStorage.getItem('user_count'))+1;
		localStorage.setItem('user_count',tag);
		var time = new Date();
		var user_array=[tag,ID.value,email.value,time,phone.value,pwd.value,user_state];
		localStorage.setItem(tag,JSON.stringify(user_array));
	}	
	 
	 
	 var skip=document.getElementById("skipa");
	 skip.innerHTML="注册成功！跳转登录";
	 window.setTimeout(function(){ window.location.href="log_in.html";},2000);

	}
}